package com.volcreate.guoqing.no6;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zxc
 * @date 2020/9/24
 */
public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] split = s.split("\\s+");
        StringBuilder stringBuilder = new StringBuilder();
        Arrays.stream(split).forEach(s1 -> {
            if (s1.length()%3==0 && !s1.equals("end")) stringBuilder.append(s1+" ");
        });
        System.out.println(stringBuilder.toString());
    }
}
